Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2617 +/- ##
=======================================
Coverage 81.16% 81.17%
=======================================
Files 42 42
Lines 33769 33826 +57
Branches 33769 33826 +57
=======================================
+ Hits 27408 27457 +49
Misses 2797 2797
- Partials 3564 3572 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Please add examples of this syntax to the fuzzer corpus. |
f4031df to
6951f1e
Compare
done! @LucaCappelletti94 |
LucaCappelletti94
left a comment
There was a problem hiding this comment.
You should link the ClickHouse sources for the new syntax in the description.
|
|
||
| target.span().union(&value.span()) | ||
| } | ||
| } |
There was a problem hiding this comment.
You should give Setting its own Spanned impl, as Assignment has, so its span is defined once and not spelled out in every statement that carries SETTINGS.
| } | |
| impl Spanned for Setting { | |
| fn span(&self) -> Span { | |
| let Setting { key, value } = self; | |
| key.span.union(&value.span()) | |
| } | |
| } |
| assert!(all_dialects_where(|d| !d.supports_settings()) | ||
| .parse_sql_statements("DELETE FROM hits WHERE x = 1 SETTINGS a = 1") | ||
| .is_err()); | ||
| } |
There was a problem hiding this comment.
You should assert the expected error, as the cases above do. is_err() also passes when the statement fails before SETTINGS is reached.
| assert!(all_dialects_where(|d| !d.supports_settings()) | |
| .parse_sql_statements("DELETE FROM hits WHERE x = 1 SETTINGS a = 1") | |
| .is_err()); | |
| } | |
| assert_eq!( | |
| all_dialects_where(|d| !d.supports_settings()) | |
| .parse_sql_statements("DELETE FROM hits WHERE x = 1 SETTINGS a = 1") | |
| .unwrap_err(), | |
| ParserError("Expected: end of statement, found: SETTINGS".to_string()) | |
| ); |
| assert!(all_dialects_where(|d| !d.supports_settings()) | ||
| .parse_sql_statements("UPDATE hits SET x = 1 WHERE y = 2 SETTINGS a = 1") | ||
| .is_err()); |
There was a problem hiding this comment.
You should assert the expected error, as the cases above do. is_err() also passes when the statement fails before SETTINGS is reached.
| assert!(all_dialects_where(|d| !d.supports_settings()) | |
| .parse_sql_statements("UPDATE hits SET x = 1 WHERE y = 2 SETTINGS a = 1") | |
| .is_err()); | |
| assert_eq!( | |
| all_dialects_where(|d| !d.supports_settings()) | |
| .parse_sql_statements("UPDATE hits SET x = 1 WHERE y = 2 SETTINGS a = 1") | |
| .unwrap_err(), | |
| ParserError("Expected: end of statement, found: SETTINGS".to_string()) | |
| ); |
Dialects: ClickHouse
These ClickHouse statements failed to parse:
This adds on_cluster and settings to Delete and Update. ON CLUSTER is parsed the same way as in other ClickHouse statements. SETTINGS is only accepted by dialects where supports_settings() is true.
Also, see code with references to SETTINGS: